<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:bs="http://none.cz">
<head th:include="common/layout::header"></head>
<body>
	<div th:substituteby="common/layout::menu"></div>
	
	<div class="container">
		<div th:include="common/layout::messages">
			cannot load messages
		</div>
		<form action="?" th:object="${form}" method="post" class="form-horizontal form-standard">
			<fieldset>
				<legend th:text="#{user.edit.legend}">User edit</legend>
				<input type="hidden" id="referer" name="referer" th:field="*{referer}"/>
				<input type="hidden" id="id" name="id" th:field="*{id}"/>
				<div class="control-group">
					<label class="control-label" for="name" th:text="#{user.edit.name}">User name</label>
					<div class="controls">
						<span id="name" class="input-large uneditable-input" th:text="${useredit.name}">a@a.cz</span>
					</div>
				</div>
				<div class="control-group" th:attrappend="class=${#fields.hasErrors('role')}? ' error'">
					<label class="control-label" for="role" th:text="#{user.edit.role}">Type</label>
					<div class="controls">
						<select name="role" id="role" th:field="*{role}" th:remove="all-but-first">
							<option value="1" th:each="type : ${allRoles}" th:value="${type}" th:text="#{${'user.roles.' + type}}">Gasstation</option>
							<option value="2">Hotel</option>
						</select>
					</div>
				</div>
				<div class="control-group" th:attrappend="class=${#fields.hasErrors('locked')}? ' error'">
					<label class="control-label" for="name" th:text="#{user.edit.locked}">locked</label>
					<div class="controls">
						<input class="input-block-level" type="checkbox" name="locked" id="locked" th:field="*{locked}" />
					</div>
				</div>		
				<div class="control-group" th:attrappend="class=${#fields.hasErrors('active')}? ' error'">
					<label class="control-label" for="name" th:text="#{user.edit.active}">active</label>
					<div class="controls">
						<input class="input-block-level" type="checkbox" name="active" id="active" th:field="*{active}" />
					</div>
				</div>
									
				<button th:text="#{form.submit}" name="_submit" class="btn btn-primary" type="submit" value="submit">Register</button>
				<button th:text="#{form.cancel}" name="_submit" class="btn" type="submit" value="cancel">Cancel</button>
			</fieldset>
		</form>
	</div>

	<div th:include="common/layout::js"></div>
</body>
</html>